﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfSysMenuConfig.aspx.cs"
    Inherits="msBsc.WebUi.wfSysMenuConfig" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>系统菜单配置</title>
    <style type="text/css">
        html, body
        {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }
    </style>
    <link href="../jqPlugin/tree/Tree.css" type="text/css" rel="stylesheet" />
    <script src='../jqPlugin/Tree/Tree.js' type='text/javascript'></script>
    <script type="text/javascript">

        //    el
        //{...}
        //    checkstate: 0
        //    ChildNodes: {...}
        //    complete: true
        //    hasChildren: true
        //    id: "BDJXS"
        //    isexpand: false
        //    parent: {...}
        //    render: true
        //    showcheck: true
        //    text: "点点滴滴"
        //    value: "BDJXS"

        function _onnodeclick(el) {
            $("#txtId").val(el.id);
            btnDo("mShowDetail");
        };
        function ShowTree(sDivId, treedata) {
            if (treedata.length <= 0) return;
            var o = {
                showcheck: false,
                //                url: 'Handler/GetTreeData.ashx',
                showcheck: true,
                cbiconpath: "../jqPlugin/Tree/Images/",
                emptyiconpath: "../jqPlugin/Tree/Images/s.gif",
                onnodeclick: _onnodeclick
            };
            o.data = treedata;
            $("#" + sDivId).treeview(o);
        };
        function successAjax(jsonitem, strSCRIPT, el) {
            if (jsonitem && jsonitem.Office && jsonitem.Office.data) {
                ShowTree("divOfficeTree", jsonitem.Office.data);
            }
        }
        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            if (sEbtn == "btnTJNew" || sEbtn == "btnZJNew") {
                $("#sAddType").val(sEbtn);
            }
            var opart = GetGtParam("myGrid1");
            if (sEbtn == "btnEdit") {
                opart.AddCell("sEditMode", "EDIT");
                ajaxComm(opart);
            }
            else if (sEbtn == "btnSave") { 
                if ($('#divOfficeDetail').validationEngine({ returnIsValid: true })) {
                    var postjson = GetFormJson("divOfficeDetail");
                    ajaxComm(opart, postjson, successAjax);
                }
            }
            else if (sEbtn == "mShowDetail") {
                ajaxComm(opart);
            }
            else if (sEbtn == "btnDelete") {
                var sSelected = $("#divOfficeTree").getTSVs().join(",");
                if (sSelected == "") {
                    if (confirm("在菜单树结构中没有选择要删除的菜单，是否要删除当前显示的菜单？")) { sSelected = $("#txtId").val(); } else { return; }
                }
                if (sSelected == "") { return; }
                opart.AddCell("SELECTED_IDS", sSelected);
                ajaxComm(opart, null, successAjax);
            }
            else if (sEbtn == "mShowOfficeTree") {
                $("#divOfficeTree").html("");
                ajaxComm(opart, null, successAjax);
            }
            else if (sEbtn == "btnTJNew" || sEbtn == "btnZJNew") {
                ajaxComm(opart);
            }
            else {
                ajaxComm(opart);
            }
            GtGrid1Action = "";
        };
        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            GetFormJson("divOfficeDetail", _jsParam);
            _jsParam.AddCell("PPAGE", "wfSysMenuConfig");
            _jsParam.AddCell("sRadom", $("#sRadom").val());
            _jsParam.AddCell("sAddType", $("#sAddType").val());
            _jsParam.AddCell("MENU_TYPE", $("#dplMenuType").val());
            _jsParam.AddCell("ID", $("#txtId").val());
            _jsParam.AddCell("ACTION", GtGrid1Action);
            return _jsParam;
        };
        $(window).load(function () {
            btnDo("mShowOfficeTree");
            $("#dplMenuType").change(function () {
                btnDo("mShowOfficeTree");
            });
            var iHeighttem1 = $(document.documentElement).height() - $("#divOfficeTree").offset().top - 80;
            $("#divOfficeTree").height(iHeighttem1);
            $("#divOfficeDetail").height(iHeighttem1);
        }); 


    </script>
</head>
<body>
    <form id="wfSysMenuConfig" method="post" runat="server">
    <asp:HiddenField ID="txtId" runat="server" Value="" />
    <asp:HiddenField ID="txtHasSelected" runat="server" />
    <div id="divCondition" style="text-align: left; margin: 8px 0px 0px 0px;">
        <center>
            <table border="0" cellpadding="0" cellspacing="0">
                <%--
            <tr>
                <td> 备选菜单
                </td>
                <td align="center" width="90px"> 
                </td>
                <td> 已选菜单
                </td>
            </tr>--%>
                <tr>
                    <td align="left" colspan="3">
                        &nbsp;<asp:Label ID="Label76" runat="server" Text="菜单类型" Width="75px"></asp:Label>
                        &nbsp;<asp:DropDownList ID="dplMenuType" runat="server" Width="130px">
                        <asp:ListItem Value="0" Text="系统后台"></asp:ListItem>
                        <asp:ListItem Value="1" Text="代理商"></asp:ListItem>
                        <asp:ListItem Value="2" Text="推广商"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div id="divOfficeTree" style="text-align: left; border-bottom: #c3daf9 1px solid;
                            border-left: #c3daf9 1px solid; width: 200px; height: 500px; overflow: auto;
                            border-top: #c3daf9 1px solid; border-right: #c3daf9 1px solid;">
                        </div>
                    </td>
                    <td align="center" width="30px">
                        <div>
                        </div>
                        <div style="margin-top: 10px;">
                        </div>
                    </td>
                    <td>
                        <div id="divOfficeDetail" style="text-align: left; width: 350px; height: 500px; overflow: auto;">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td class="label" width="120px">
                                    </td>
                                    <td>
                                        <span id="txtOperate"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label9" runat="server" Text="序号" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtMENU_SEQ_ON_LEVEL" runat="server" Width="60px" MaxLength=" 100 "
                                            class="validate[required] text-input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label10" runat="server" Text="当前菜单ID" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <span id="spnMENU_CONFIG_ID"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label2" runat="server" Text="上级菜单ID" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPARENT_MENU_ID" runat="server" Width="160px" MaxLength=" 100 "></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label1" runat="server" Text="菜单图标" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtWEB_IMG_FILE_NAME" runat="server" Width="190px" MaxLength=" 100 "></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label42" runat="server" Text="中文名称" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtMENU_NAME" runat="server" Width="230px" MaxLength=" 100 " class="validate[required] text-input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label3" runat="server" Text="英文名称" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtMENU_NAME_IN_ENGLISH" runat="server" Width="230px" MaxLength=" 100 "></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label4" runat="server" Text="页面宽/高" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtWEB_PAGE_WIDTH" runat="server" Width="60px" MaxLength=" 100 "></asp:TextBox>
                                        <asp:TextBox ID="txtWEB_PAGE_HEIGHT" runat="server" Width="60px" MaxLength=" 100 "></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label5" runat="server" Text="打开路径" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtWEB_PAGE_NAME" runat="server" Width="220px" MaxLength=" 100 "></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label6" runat="server" Text="主菜单" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="ckbIS_ROOT" runat="server" Text="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label7" runat="server" Text="开始分组" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="ckbBEGIN_GROUP" runat="server" Text="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label75" runat="server" Text="新窗口中打开" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="ckbNEW_WINDOW" runat="server" Text="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label" width="120px">
                                        <asp:Label ID="Label8" runat="server" Text="是否有效" Width="75px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="ckbREC_ACTIVE" runat="server" Text="" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </center>
    </div>
    <div style="text-align: center; margin: 5px; padding-top: 0; border-top-style: solid;
        border-top-width: 2px; border-top-color: #eb6100;">
        <center>
            <table style="vertical-align: bottom;">
                <tr>
                    <td>
                        <input type="button" onclick="btnDo('btnTJNew');" value="增加同级菜单(A)" id="btnTJNew"
                            accesskey="A" disabled="disabled" />
                        <input type="button" onclick="btnDo('btnZJNew');" value="增加子级菜单(C)" id="btnZJNew"
                            accesskey="C" disabled="disabled" />
                        <input type="button" onclick="btnDo('btnEdit');" value="修改(E)" id="btnEdit" accesskey="E"
                            disabled="disabled" class="button_Finder" />
                        <input type="button" onclick="btnDo('btnSave');" value="保存(S)" id="btnSave" accesskey="S"
                            disabled="disabled" class="button_Finder" />
                        <input type="button" onclick="if(confirm('确认要删除吗？'))btnDo('btnDelete');" value="删菜单(D)"
                            id="btnDelete" accesskey="D" disabled="disabled" />
                    </td>
                </tr>
            </table>
        </center>
    </div>
    <div id="divSelectedShow" style="">
    </div>
    <asp:HiddenField ID="sRadom" runat="server" />
    <asp:HiddenField ID="txtEditMode" runat="server" />
    <asp:HiddenField ID="sIsRefreshData" runat="server" />
    <asp:HiddenField ID="sAddType" runat="server" />
    </form>
</body>
</html>
